package com.hk.web.domain.lifeCycle.repository;

import com.hk.commons.enums.AuthMenuType;
import com.hk.web.domain.entity.RoleAssignMenu;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * Created by Antinomy on 16/12/14.
 */
public interface RoleAssignMenuRepository extends JpaRepository<RoleAssignMenu, Long> {

    void deleteByRoleId(Long roleId);

    List<RoleAssignMenu> findByRoleId(Long roleId);

    List<RoleAssignMenu> findByMenuTypeAndRoleId(AuthMenuType menuType, Long roleId);

    List<RoleAssignMenu> findByMenuTypeAndRoleIdAndParentId(AuthMenuType menuType, Long roleId, Long parentId);
}
